import Taro, { Component } from "@tarojs/taro";
import Index from "./pages/index";

import "./app.less";

import "taro-ui/dist/style/index.scss"; // 引入组件样式 - 方式一

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

class App extends Component {
  componentDidMount() {}

  componentDidShow() {}

  componentDidHide() {}

  componentDidCatchError() {}

  config = {
    pages: [
      "pages/echar/index",
      "pages/hooks/index",
      "pages/demo2/index",
      "pages/demo/index",
      "pages/index/index",
    ],
    tabBar: {
      list: [
        {
          pagePath: "pages/echar/index",
          text: "echar",
        },
        {
          pagePath: "pages/demo/index",
          text: "按钮1",
        },
        {
          pagePath: "pages/demo2/index",
          text: "按钮2",
        },
        {
          pagePath: "pages/hooks/index",
          text: "hooks",
        },
      ],
    },
    window: {
      backgroundTextStyle: "light",
      navigationBarBackgroundColor: "#fff",
      navigationBarTitleText: "WeChat",
      navigationBarTextStyle: "black",
    },
  };

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render() {
    return <Index />;
  }
}

Taro.render(<App />, document.getElementById("app"));
